package com.springboot2.demo.controller;

import com.alibaba.fastjson.JSON;
import com.springboot2.demo.bean.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Alan
 * @date: 2020/12/4 23:22
 */
@RestController
@RequestMapping("test")
@Slf4j
public class TestController {

    @RequestMapping("testHello")
    public String testHello(){
        User user = new User();
        user.setAddress("test");
        user.setAge(2);
        user.setName("hello");
        log.info("user:{}",user);
        log.info("user JSON:{}", JSON.toJSONString(user));
        return "hello";
    }

}
